<!DOCTYPE html>
<html xmlns:shiro="http://www.pollix.at/thymeleaf/shiro"
      xmlns:th="http://www.thymeleaf.org" layout:decorate="main"
      xmlns:layout="http://www.ultraq.net.nz/web/thymeleaf/layout">
<head>
    <title>书籍仓库</title>
    <link th:href="@{/localcss/crmlist.css}" href="../static/localcss/crmlist.css" rel="stylesheet">
</head>
<body>
<div layout:fragment="content">
    <div class="">
        <div class="clearfix"></div>
        <div class="row">

            <div class="col-md-12 col-sm-12 col-xs-12">
                <div class="x_panel">
                    <div class="x_content">
                        <p class="text-muted font-13 m-b-30"></p>
                        <div id="datatable-responsive_wrapper"
                             class="dataTables_wrapper form-inline dt-bootstrap no-footer">
                            <div class="row">
                                <div class="col-sm-12">
                                    <table id="datatable-responsive"
                                           class="table table-striped table-bordered dt-responsive nowrap dataTable no-footer dtr-inline collapsed"
                                           cellspacing="0" width="100%" role="grid"
                                           aria-describedby="datatable-responsive_info" style="width: 100%;">
                                        <thead>
                                        <tr role="row">
                                            <th class="sorting_asc" tabindex="0"
                                                aria-controls="datatable-responsive" rowspan="1" colspan="1"
                                                aria-label="First name: activate to sort column descending"
                                                aria-sort="ascending">编号
                                            </th>
                                            <th class="sorting" tabindex="0"
                                                aria-controls="datatable-responsive" rowspan="1" colspan="1"
                                                aria-label="Last name: activate to sort column ascending">
                                                书籍名称
                                            </th>
                                            <th class="sorting" tabindex="0"
                                                aria-controls="datatable-responsive" rowspan="1" colspan="1"
                                                aria-label="Last name: activate to sort column ascending">
                                                书籍出版社
                                            </th>
                                            <th class="sorting" tabindex="0"
                                                aria-controls="datatable-responsive" rowspan="1" colspan="1"
                                                aria-label="Last name: activate to sort column ascending">
                                                书籍作者
                                            </th>
                                            <th class="sorting" tabindex="0"
                                                aria-controls="datatable-responsive" rowspan="1" colspan="1"
                                                aria-label="Last name: activate to sort column ascending">
                                                图书发布时间
                                            </th>

                                            <th class="sorting" tabindex="0"
                                                aria-controls="datatable-responsive" rowspan="1" colspan="1"
                                                aria-label="Last name: activate to sort column ascending">
                                                图书类别
                                            </th>
                                        </tr>
                                        </thead>
                                        <tbody>
                                        <tr role="row" class="odd" th:each="user:${bookInfo}">
                                            <td tabindex="0" class="sorting_1" th:text="${user.id}">usrId</td>
                                            <td th:text="${user.bookName}">23456</td>
                                            <td th:text="${user.publish}">roleName</td>
                                            <td th:text="${user.author}">roleName</td>
                                            <td th:text="${user.publishTime}">roleName</td>
                                            <td th:text="${user.getBookCategory().getBookCategoryName()}">roleName</td>
                                        </tr>
                                        </tbody>
                                    </table>
                                    <!--<div class="row">-->
                                        <!--<div class="col-sm-5">-->
                                            <!--<div class="dataTables_info" id="datatable-responsive_info"-->
                                                 <!--role="status" aria-live="polite">共<span-->
                                                    <!--th:text="${userPager.totalElements }">1</span>条记录-->
                                                <!--<span th:text="${userPager.number+1 }">1</span>/<span-->
                                                        <!--th:text="${userPager.totalPages }">1</span>页-->
                                            <!--</div>-->
                                            <!--<div class="col-sm-7">-->
                                                <!--<div class="dataTables_paginate paging_simple_numbers"-->
                                                     <!--id="datatable-responsive_paginate">-->
                                                    <!--<ul class="pagination">-->
                                                        <!--<li class="paginate_button previous"-->
                                                            <!--th:if="${userPager.number gt 0}"><a-->
                                                                <!--href="javascript:page_nav(document.forms[0],1);"-->
                                                                <!--aria-controls="datatable-responsive" data-dt-idx="0"-->
                                                                <!--tabindex="0">首页</a>-->
                                                        <!--</li>-->
                                                        <!--<li class="paginate_button " th:if="${userPager.number gt 0}"><a-->
                                                                <!--href="#"-->
                                                                <!--th:onclick="'javascript:page_nav(document.forms[0],'+${userPager.number }+');'"-->
                                                                <!--aria-controls="datatable-responsive" data-dt-idx="1"-->
                                                                <!--tabindex="0">上一页</a>-->
                                                        <!--</li>-->
                                                        <!--<li class="paginate_button "-->
                                                            <!--th:if="${(userPager.number+1) lt userPager.totalPages}"><a-->
                                                                <!--href="#"-->
                                                                <!--th:onclick="'javascript:page_nav(document.forms[0],'+${userPager.number+2 }+');'"-->
                                                                <!--aria-controls="datatabl.-->
                                                            <!--0e-responsive" data-dt-idx="1"-->
                                                                <!--tabindex="0">下一页</a>-->
                                                        <!--</li>-->
                                                        <!--<li class="paginate_button next"-->
                                                            <!--th:if="${(userPager.number+1) lt userPager.totalPages}"><a-->
                                                                <!--href="#"-->
                                                                <!--th:onclick="'javascript:page_nav(document.forms[0],'+${userPager.totalPages }+');'"-->
                                                                <!--aria-controls="datatable-responsive" data-dt-idx="7"-->
                                                                <!--tabindex="0">最后一页</a>-->
                                                        <!--</li>-->
                                                    <!--</ul>-->
                                                <!--</div>-->
                                            <!--</div>-->
                                        <!--</div>-->
                                    <!--</div>-->
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
</body>
<script layout:fragment="js">
    function doDel(obj, id) {
        if (confirm("你确定需要删除该用户信息吗？")) {
            $.ajax({
                type: "get",
                url: "/user/del",
                data: "id=" + id,
                dataType: "json",
                success: function (data) {
                    if (data.dek == "true") {//删除成功：移除删除行alert("删除成功！");
                        $(obj).parents("tr").remove();
                    }
                },
                error: function (data) {
                    alert("对不起，删除失败！" + date.dek);
                }
            });
        }
    }
</script>
</html>